//
//  YTAccountMoneyDetailViewCell.m
//  YiTuDriverClient
//
//  Created by 石少庸 on 2017/5/22.
//  Copyright © 2017年 Yitu. All rights reserved.
//

#import "YTAccountMoneyDetailViewCell.h"
#import "YTWithdrawRecordModel.h"

@interface YTAccountMoneyDetailViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *typeText;
@property (weak, nonatomic) IBOutlet UILabel *timeText;
@property (weak, nonatomic) IBOutlet UILabel *orderText;
@property (weak, nonatomic) IBOutlet UILabel *leftMoneyText;
@property (weak, nonatomic) IBOutlet UILabel *operationText;

@end

@implementation YTAccountMoneyDetailViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setModel:(YTWithdrawRecordModel *)model {
    _model = model;
    
    _typeText.text = model.actionName;
    _orderText.text = model.content;
    _timeText.text = model.addTime;
    _leftMoneyText.text = model.remain;
    
    if ([model.account_in floatValue] > 0) {
        _operationText.text = [NSString stringWithFormat:@"+ %@", model.account_in];
    }
    
    if ([model.account_out floatValue] > 0) {
        _operationText.textColor = kMainBlueColor;
        _operationText.text = [NSString stringWithFormat:@"- %@", model.account_out];
    }
}

- (void)prepareForReuse {
    [super prepareForReuse];
    _operationText.textColor = [UIColor redColor];
    _operationText.text = @"";
    _typeText.text = @"";
    _orderText.text = @"";
    _timeText.text = @"";
    _leftMoneyText.text = @"";
}

@end
